import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: '系统首页',
        icon: 'ionic',
        meta: {
            active: false,
            title: '系统首页',
            keepAlive: false,
        },
        component: () => import('../views/home/home.vue')
      },
      // 从这写
      {
        path: 'orderList',
        name: '订单列表',
        icon: 'ionic',
        meta: {
            active: false,
            title: '订单列表',
            keepAlive: false,
        },
        component: () => import('../views/order/order.vue')
      },

      {
        path: 'administration',
        name: '商品列表',
        icon: 'ionic',
        meta: {
            active: false,
            title: '商品列表',
            keepAlive: false,
        },
        component: () => import('../views/administration/administration.vue')
      },

      {
        path: 'commodityList',
        name: '商品设置',
        icon: 'ionic',
        meta: {
            active: false,
            title: '商品设置',
            keepAlive: false,
        },
        component: () => import('../views/administration/commodityList.vue')
      },

      {
        path: 'shopcarList',
        name: '购物车',
        icon: 'ionic',
        meta: {
            active: false,
            title: '购物车',
            keepAlive: false,
        },
        component: () => import('../views/shopcar/shopcar.vue')
      },
      {
        path: 'userList',
        name: '用户列表',
        icon: 'ionic',
        meta: {
            active: false,
            title: '用户列表',
            keepAlive: false,
        },
        component: () => import('../views/userList/userList.vue')
      },

      {
        path: 'display',
        name: '显示设置',
        icon: 'ionic',
        meta: {
            active: false,
            title: '显示设置',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/display.vue')
      },

      {
        path: 'advertList',
        name: '广告列表',
        icon: 'ionic',
        meta: {
            active: false,
            title: '广告列表',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/advert.vue')
      },

      {
        path: 'notice',
        name: '公告管理',
        icon: 'ionic',
        meta: {
            active: false,
            title: '公告管理',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/notice.vue')
      },

      {
        path: 'freight',
        name: '运费模块',
        icon: 'ionic',
        meta: {
            active: false,
            title: '运费模块',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/freight.vue')
      },

      {
        path: 'express',
        name: '快递设置',
        icon: 'ionic',
        meta: {
            active: false,
            title: '快递设置',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/express.vue')
      },

      {
        path: 'administrators',
        name: '管理员',
        icon: 'ionic',
        meta: {
            active: false,
            title: '管理员',
            keepAlive: false,
        },
        component: () => import('../views/shopSettings/administrators.vue')
      },

    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/login.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
